package base;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class User {
    @JsonProperty("user_id")
    public int userId;

    public boolean test;
    @JsonProperty("user_name")
    public String userName;

    @JsonProperty("email_address")
    public String emailAddress;

    @JsonIgnore
    public String password;

    public Meta meta = new Meta();

    // 无参构造函数
    public User() {}

    // 带参构造函数
    public User(int userId, String userName, String emailAddress, String password) {
        this.userId = userId;
        this.userName = userName;
        this.emailAddress = emailAddress;
        this.password = password;
    }

    @Setter
    @Getter
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class Meta {
        public Integer a;

    }
}